package com.ck.ips.service.impl.program;

import com.ck.common.model.OperationResult;
import com.ck.common.model.ProgramDownload;
import com.ck.ips.dao.program.ProgramDownloadMapper;
import com.ck.ips.model.vo.program.ProgramStatisticsInfoVO;
import com.ck.ips.service.program.ProgramDownloadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author linqiang
 * @version v1.0
 * @Description 节目下载下发Service实现类
 * @date 2019-04-29 16:44
 */
@Service(value = "programDownloadService")
public class ProgramDownloadServiceImpl implements ProgramDownloadService {

    @Autowired
    private ProgramDownloadMapper programDownloadMapper;

    @Override
    public int deleteByPrimaryKey(Long programDownloadId) {
        return programDownloadMapper.deleteByPrimaryKey(programDownloadId);
    }

    @Override
    public int insert(ProgramDownload record) {
        return programDownloadMapper.insert(record);
    }

    @Override
    public ProgramDownload selectByPrimaryKey(Long programDownloadId) {
        return programDownloadMapper.selectByPrimaryKey(programDownloadId);
    }

    /**
     * 批量新增
     *
     * @param programDownloadList 数据
     * @return 影响行数
     */
    @Override
    public int batchInsert(List<ProgramDownload> programDownloadList) {
        return programDownloadMapper.batchInsert(programDownloadList);
    }

    /**
     * 批量删除
     *
     * @param programVersionList 节目版本号
     */
    @Override
    public void batchDelete(List<String> programVersionList) {
        programDownloadMapper.batchDelete(programVersionList);
    }

    /**
     * 批量修改状态
     *
     * @param programVersionList 节目版本号
     * @param deviceCode         设备序列号
     * @param newStatus          新状态
     */
    @Override
    public void batchUpdateStatus(List<String> programVersionList, String deviceCode, Integer newStatus) {
        programDownloadMapper.batchUpdateStatus(programVersionList, deviceCode, newStatus);
    }
}
